#encoding: utf-8

# 导入etree时需要手动，不会有提示
from lxml import etree
import requests


def findText():
    # 2. 发送请求, 获取响应
    response = requests.get('https://www.tuliu.com/read-135151.html')
    response.encoding = 'utf8'
    html = etree.HTML(response.text, etree.HTMLParser())
    result = html.xpath('/html/body/div[2]/div[3]/div[1]/div[1]/div[1]/h2/text()')
    print(result)


if __name__ == '__main__':
    findText()
